#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
    __init__.py
    ~~~~~~~~~~~~~~~~~~~~~~~

    Description of this file

    :author: LiYang
    :copyright: (c) 2020, Tungee
    :date created: 2020/9/4
    :python version: 2.7
"""
import sys


"""
window = global;
top = window;
window['decodeURI'] = decodeURI;
window['history'] = {length: 2, scrollRestoration: "auto", state: null};
window['screen'] = {
    availHeight: 1056,
    availLeft: 65,
    availTop: 24,
    availWidth: 1855,
    colorDepth: 24,
    height: 1080,
    pixelDepth: 24,
    width: 1920,
};
window['navigator'] = {
    webdriver: undefined,
    userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
    appVersion: '5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
};

var document = {
    getElementById: function () {
        glcanvaxs = {}
    },
    createElement: function () {
        CanvasRenderingContext2D = {
            arc: function arc() {
            },
            stroke: function stroke() {
            },
            fillText: function fillText() {
            },
            fillRect: function fillRect() {
            },
        };
        canvas = {
            getContext: function getContext() {
                return CanvasRenderingContext2D
            },
            toDataURL: function toDataURL() {
                return ""
            },
        };
        return canvas;
    },
    title: "求职|找工作|最新招聘信息-BOSS直聘",
    cookie: "",
};

window['document'] = document;
window['location'] = {
    hash: "",
    host: "www.zhipin.com",
    hostname: "www.zhipin.com",
    href: "https://www.zhipin.com/web/common/security-js/bed4fa64.js",
    origin: "https://www.zhipin.com",
    pathname: "/web/common/security-js/bed4fa64.js",
    port: "",
    protocol: "https:",
};
"""

"""
var name = '0f35c990';
seed = 'T0ZKSDv/dj67q0KQ3W7k5ewjgZ9Y1IgsKpPx/rNXObE=';
ts = '1599445237911';
// 35adbWDcKbXUof2hVGUh8JUB2MF9mbwEHWDAiQTkoQx5zJX8ycxkbPzUjO397EG8hJi5wQCB6GGVQbCIaYUd5ZjkVNXIfITZEKTIYfVYvKGNSFG94Eig5BgNMTU4EKx9aIH8NJmQOFxtdR3V5dA%3D%3D
// 35adbWDcKbXUof2hVGUh8JUB2MF9mbwEHWDAiQTkoQx5zJX8ycxkbPzUjO397EG8hJi5wQCB6GGVQbCIaYUd5ZjkVNXIfITZEKTIYfVYvKGNSFG94Eig5BgNMTU4EKx9aIH8NJmQOFxtdR3V5dA==
code = new ABC().z(seed, parseInt(ts) + (480 + new Date().getTimezoneOffset()) * 60 * 1000);
console.log('----------------结果:----------------');
console.log(code);
"""


"""
// window = new Proxy(global, {
//     get: function (target, key, receiver) {
//         console.log("window.get", key, target[key]);
//         if (key == "location") {
//             location = new Proxy(target[key], {
//                 get: function (_target, _key, _receiver) {
//                     console.log("window.get", key, _key, _target[_key]);
//                     if (_key == "port") {
//                         console.log("port")
//                     }
//                     return _target[_key];
//                 }
//             })
//         }
//         return target[key];
//     },
//     set: function (target, key, value, receiver) {
//         console.log("window.set", key, value);
//         target[key] = value;
//     }
// });

window = global;
var document = {
    getElementById: function () {
        glcanvaxs = {}
    },
    createElement: function () {
        CanvasRenderingContext2D = {
            arc: function arc() {
            },
            stroke: function stroke() {
            },
            fillText: function fillText() {
            },
            fillRect: function fillRect() {
            },
        };
        canvas = {
            getContext: function getContext() {
                return CanvasRenderingContext2D
            },
            toDataURL: function toDataURL() {
                return ""
            },
        };
        return canvas;
    },
    title: "求职|找工作|最新招聘信息-BOSS直聘",
    cookie: "",
};

window['document'] = document;
window['callPhantom'] = undefined;
window['_phantom'] = undefined;
window['length'] = 0;
window['history'] = {length: 2, scrollRestoration: "auto", state: null};
window['screen'] = {
    availHeight: 1056,
    availLeft: 65,
    availTop: 24,
    availWidth: 1855,
    colorDepth: 24,
    height: 1080,
    pixelDepth: 24,
    width: 1920,
};
window['navigator'] = {
    language: "en-US",
    cookieEnabled: true,
    webdriver: undefined,
    appCodeName: "Mozilla",
    appName: "Netscape",
    appVersion: "5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36",
    userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
};
window['location'] = {
    hash: "",
    host: "www.zhipin.com",
    hostname: "www.zhipin.com",
    href: "https://www.zhipin.com/web/common/security-js/bed4fa64.js",
    origin: "https://www.zhipin.com",
    pathname: "/web/common/security-js/bed4fa64.js",
    port: "",
    protocol: "https:",
};
window['atob'] = function (value) {
    return new Buffer(value, 'base64').toString();
};
top = window;

"""
